﻿<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"         
        xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
        xmlns:Primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone"
        xmlns:localCtrls="clr-namespace:XingZhe.Controls"
        xmlns:sl8Helper="clr-namespace:SL8.SL.Helpers;assembly=SL8.SL"
        mc:Ignorable="d">

        <Style x:Key="PanoramaItemStyle" TargetType="phone:PanoramaItem">
                <Setter  Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="phone:PanoramaItem" >
                                        <Grid Margin="12" >
                                                <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition/>
                                                </Grid.RowDefinitions>
                                                <Grid Visibility="{Binding  Path=(sl8Helper:VisualElementService.Visibility), RelativeSource={RelativeSource Mode=TemplatedParent}}">
                                                        <TextBlock FontSize="48" Margin="10,6" Text="{TemplateBinding Property=Header}"/>
                                                </Grid>
                                                <Grid Grid.Row="1">
                                                        <Border Background="#10000000" Visibility="Collapsed"/>
                                                        <ContentPresenter VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                                                </Grid>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <Style x:Key="PanoramaStyle" TargetType="phone:Panorama">
                <Setter Property="ItemsPanel">
                        <Setter.Value>
                                <ItemsPanelTemplate>
                                        <Primitives:PanoramaPanel x:Name="panel"/>
                                </ItemsPanelTemplate>
                        </Setter.Value>
                </Setter>
                <Setter Property="Foreground" Value="{StaticResource ResourceKey=PhoneForegroundBrush}"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="phone:Panorama">
                                        <Grid>
                                                <Grid.RowDefinitions>
                                                        <RowDefinition Height="auto"/>
                                                        <RowDefinition Height="*"/>
                                                </Grid.RowDefinitions>
                                                <Primitives:PanningBackgroundLayer x:Name="BackgroundLayer" HorizontalAlignment="Left" Grid.RowSpan="2">
                                                </Primitives:PanningBackgroundLayer>
                                                <Primitives:PanningLayer x:Name="ItemsLayer" HorizontalAlignment="Left" Grid.Row="1">
                                                        <ItemsPresenter x:Name="items"/>
                                                </Primitives:PanningLayer>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
                <Setter Property="ItemContainerStyle" Value="{StaticResource ResourceKey=PanoramaItemStyle}"/>
        </Style>
</ResourceDictionary>
